package hhh.com.choose_class;

import android.content.Intent;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button bt_add,bt_find,bt_search,bt_exit;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bt_add = (Button) findViewById(R.id.bt_add);
        bt_find = (Button) findViewById(R.id.bt_find);
        bt_search = (Button) findViewById(R.id.bt_search);
        bt_exit = (Button) findViewById(R.id.bt_exit);

        bt_add.setOnClickListener(this);
        bt_find.setOnClickListener(this);
        bt_search.setOnClickListener(this);
        bt_exit.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.bt_add:
                Intent intent = new Intent(this,add.class);
                startActivity(intent);
                break;

            case R.id.bt_find:
                Intent intent1 = new Intent(this,find.class);
                startActivity(intent1);
                break;

            case R.id.bt_search:
                Intent intent2 = new Intent(this,Main2Activity.class);
                startActivity(intent2);
                break;

            case R.id.bt_exit:
                finish();
                break;
        }
    }
}
